Fix FTBFS on hurd-i386 and non-java ports. (Closes: #978659)
authorSamuel Thibault <sthibault@debian.org>
Mon, 4 Jan 2021 21:05:06 +0000 (22:05 +0100)
committerAnton Gladky <gladk@debian.org>
Mon, 4 Jan 2021 21:05:06 +0000 (22:05 +0100)
debian/control
debian/patches/95_java_mach-arch_fix.patch [new file with mode: 0644]
debian/patches/series
debian/rules

index 3de3d7665924f16f0ef0c12be79e9404a5bde8b7..f1def24f98a9eea9b2102b284b2cddb2872dd62d 100644 (file)
@@ -8,7 +8,7 @@ Priority: optional
 Build-Depends: chrpath,
                cmake (>= 3.2.0),
                debhelper-compat (= 13),
-               default-jdk,
+               default-jdk [!hppa !hurd-any !kfreebsd-any],
                default-libmysqlclient-dev,
                dh-python,
                doxygen-latex,
@@ -115,7 +115,7 @@ Depends: ${misc:Depends},
          libtiff-dev,
          libutfcpp-dev,
          libvtk9 (= ${binary:Version}),
-         libvtk9-java (= ${binary:Version}),
+         libvtk9-java (= ${binary:Version}) [!hppa !hurd-any !kfreebsd-any],
          libx11-dev,
          libxft-dev,
          libxml2-dev,
@@ -161,7 +161,7 @@ Description: VTK libraries
  that use VTK.
 
 Package: libvtk9-java
-Architecture: any
+Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32
 Section: java
 Depends: ${java:Depends},
          ${misc:Depends},
diff --git a/debian/patches/95_java_mach-arch_fix.patch b/debian/patches/95_java_mach-arch_fix.patch
new file mode 100644 (file)
index 0000000..a302125
--- /dev/null
@@ -0,0 +1,40 @@
+https://gitlab.kitware.com/diatomic/diy/-/merge_requests/59
+
+From bb0d55c8ae34a43354b1002262dad722c410d8cb Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date: Sat, 13 Jun 2020 13:59:31 +0200
+Subject: [PATCH] Fix build on mach-based OS which are not OS X
+
+---
+ include/diy/time.hpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/time.hpp b/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/time.hpp
+index 692cf36..671e69d 100644
+--- a/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/time.hpp
++++ b/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/time.hpp
+@@ -3,11 +3,11 @@
+ #ifndef _WIN32
+ #include <sys/time.h>
+-#ifdef __MACH__
++#if defined(__MACH__) && defined(__APPLE__)
+ #include <mach/clock.h>
+ #include <mach/mach.h>
+-#endif // __MACH__
++#endif // __MACH__ && __APPLE__
+ #endif // ifndef _WIN32
+ namespace diy
+ {
+@@ -16,7 +16,7 @@ typedef     unsigned long       time_type;
+ inline time_type get_time()
+ {
+-#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
++#if defined(__MACH__) && defined(__APPLE__) // OS X does not have clock_gettime, use clock_get_time
+     clock_serv_t cclock;
+     mach_timespec_t ts;
+     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+-- 
+GitLab
index ef2e24cf7a8f1ff19d1ebbc67fa48dc5df42481c..9479c5a48369ecff34c7e2aa86f00665e62f0060 100644 (file)
@@ -10,3 +10,5 @@
 82_allow_gles_platforms.patch
 83_allow_gles_platforms.patch
 90_fix_freetype_compilation.patch
+95_java_mach-arch_fix.patch
+97_reproducible_builds.patch
index 28d8f8e4ae631c5318f3cadac837b051159f77f1..5206482fbd79d8b9a58e628d7fdbb016d05af1ab 100755 (executable)
@@ -3,7 +3,11 @@ BUILDDIR = $(CURDIR)/debian/build
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-export JAVA_HOME=/usr/lib/jvm/default-java
+nojava_archs=hppa hurd-i386 kfreebsd-i386 kfreebsd-amd64
+ifneq ($(DEB_BUILD_ARCH),$(filter $(DEB_BUILD_ARCH), $(nojava_archs)))
+  export JAVA_HOME=/usr/lib/jvm/default-java
+  extra_flags += -DVTK_WRAP_JAVA=ON
+endif
 
 ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc sh4))
   export DEB_CXXFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
@@ -52,7 +56,6 @@ extra_flags +=  \
        -DVTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=ON \
        -DVTK_PYTHON_VERSION:STRING=3 \
        -DVTK_USE_TK=ON \
-       -DVTK_WRAP_JAVA=ON \
        -DVTK_WRAP_PYTHON=ON \
     -DCMAKE_BUILD_TYPE=RelWithDebInfo
 
@@ -70,8 +73,10 @@ override_dh_auto_build:
 
 override_dh_auto_install:
        dh_auto_install -X.pyc -X.pyo
+ifneq ($(JAVA_HOME),)
        # Correct headers for paraview
        mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/java/vtk.jar $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/java/vtk9.jar
+endif
        sed -i -e "s/FATAL_ERROR/STATUS/g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/vtk-9.0/VTK-targets.cmake
 
 override_dh_install: